Sonic2DUpdater = function(go, collideables) {
    Updater.call(this, go);
    this.collideables = collideables;
};

Sonic2DUpdater.prototype = Object.create(Updater.prototype);

Sonic2DUpdater.prototype.run = function() {
    var go = this.gameObject || this.go;
    var collideables = this.collideables;

    go.vy += 1;

    // preparing the variables
    var moveBy = {
        x: 0,
        y: go.vy
    };
    var collision = null;

    collision = calculateCollision(go, 'y', collideables, moveBy);
    console.log(moveBy);
    go.move(0,moveBy.y);

    if (!collision) {
        if (go.onGround) {
            go.onGround = false;
            go.doubleJump = true;
        }
    } else {
        // the hero can only be 'onGround'
        // when he's hitting floor and not
        // some ceiling
        if (moveBy.y > 0) {
            go.onGround = true;
            go.doubleJump = false;
        }
        go.vy = 0;
    }

    moveBy = {
        x: go.vx,
        y: 0
    };
    collision = calculateCollision(go, 'x', collideables, moveBy);
    go.move(moveBy.x,0);
};
